/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.sorbonne.soa.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Nairo
 */
@Entity
@Table(name = "PRODUCTINFO")
@NamedQueries({@NamedQuery(name = "Productinfo.findAll", query = "SELECT p FROM Productinfo p"), @NamedQuery(name = "Productinfo.findByProducttypeid", query = "SELECT p FROM Productinfo p WHERE p.producttypeid = :producttypeid"), @NamedQuery(name = "Productinfo.findByProducttype", query = "SELECT p FROM Productinfo p WHERE p.producttype = :producttype"), @NamedQuery(name = "Productinfo.findByShippingconditions", query = "SELECT p FROM Productinfo p WHERE p.shippingconditions = :shippingconditions")})
public class Productinfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PRODUCTTYPEID")
    private String producttypeid;
    @Basic(optional = false)
    @Column(name = "PRODUCTTYPE")
    private String producttype;
    @Basic(optional = false)
    @Column(name = "SHIPPINGCONDITIONS")
    private String shippingconditions;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "product3")
    private Collection<Manufacturerinfo> manufacturerinfoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "product2")
    private Collection<Manufacturerinfo> manufacturerinfoCollection1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "product1")
    private Collection<Manufacturerinfo> manufacturerinfoCollection2;

    public Productinfo() {
    }

    public Productinfo(String producttypeid) {
        this.producttypeid = producttypeid;
    }

    public Productinfo(String producttypeid, String producttype, String shippingconditions) {
        this.producttypeid = producttypeid;
        this.producttype = producttype;
        this.shippingconditions = shippingconditions;
    }

    public String getProducttypeid() {
        return producttypeid;
    }

    public void setProducttypeid(String producttypeid) {
        this.producttypeid = producttypeid;
    }

    public String getProducttype() {
        return producttype;
    }

    public void setProducttype(String producttype) {
        this.producttype = producttype;
    }

    public String getShippingconditions() {
        return shippingconditions;
    }

    public void setShippingconditions(String shippingconditions) {
        this.shippingconditions = shippingconditions;
    }

    public Collection<Manufacturerinfo> getManufacturerinfoCollection() {
        return manufacturerinfoCollection;
    }

    public void setManufacturerinfoCollection(Collection<Manufacturerinfo> manufacturerinfoCollection) {
        this.manufacturerinfoCollection = manufacturerinfoCollection;
    }

    public Collection<Manufacturerinfo> getManufacturerinfoCollection1() {
        return manufacturerinfoCollection1;
    }

    public void setManufacturerinfoCollection1(Collection<Manufacturerinfo> manufacturerinfoCollection1) {
        this.manufacturerinfoCollection1 = manufacturerinfoCollection1;
    }

    public Collection<Manufacturerinfo> getManufacturerinfoCollection2() {
        return manufacturerinfoCollection2;
    }

    public void setManufacturerinfoCollection2(Collection<Manufacturerinfo> manufacturerinfoCollection2) {
        this.manufacturerinfoCollection2 = manufacturerinfoCollection2;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (producttypeid != null ? producttypeid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Productinfo)) {
            return false;
        }
        Productinfo other = (Productinfo) object;
        if ((this.producttypeid == null && other.producttypeid != null) || (this.producttypeid != null && !this.producttypeid.equals(other.producttypeid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.sorbonne.soa.entity.Productinfo[producttypeid=" + producttypeid + "]";
    }

}
